<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>calypso_transaction_c.html</title>
<!-- Source : c:/temp/calypso/calypso_transaction.c -->
<!-- Doc generated on Thu Jun 24 12:26:44 2010 by johann on PC_DEV_5 -->
<!-- Generated with ROBODoc Version 4.99.8 (Specific build by PRO ACTIVE - Apr 13 2010) -->
<style type="text/css">
body
{
  background-color: #ffffff;
  color: #000000;
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 9pt;
  margin-left: 60px;
  margin-right: 40px;  
}
table
{
  border-collapse: collapse;
  border-style: solid;
  border-width: 1px;
  border-color: #000000;
  margin-bottom: 12px;
}
td
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 9pt;
  vertical-align: top;
  padding-right: 6px;
  border-style: solid;
  border-width: 1px;
  border-color: #dddddd; 
}
th
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 9pt;
  vertical-align: top;  
  padding-right: 6px;
  border-style: solid;
  border-width: 1px;
  border-color: #000000;
  background-color: #dddddd;  
}
h1
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 18pt;
  font-weight: bold;
  margin-bottom: 36px;
  color: #000000;
  margin-left: -40px;
}
h2
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 12pt;
  font-weight: bold;
  margin-top: 48px;
  margin-bottom: 24px;
  padding-top: 2px;
  padding-bottom: 2px;
  background-color: #dddddd;
  color: #000000;
  margin-left: -40px;
}
h3
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 11pt;
  font-weight: bold;
  margin-top: 36px;
  margin-bottom: 24px; 
  border-style: none;
  border-top-style: solid;  
  border-width: 1px;
  border-color: #cccccc; 
  margin-left: -40px;
}
h4
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 11pt;
  font-weight: bold;
  margin-top: 24px;
  margin-bottom: 12px;  
}
h5
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 9pt;
  font-weight: bold;
  margin-top: 12px;
  margin-bottom: 2px;  
}
a
{
  color: #0000ff;
}
p
{
  margin-top: 0px;
  margin-bottom: 6px;  
  width: 600px;
  text-align: justify;
}
ul
{
  margin-top: 0px;
  margin-bottom: 6px;  
  width: 600px;
  text-align: justify;
}
li
{
  margin-top: 0px;
  margin-bottom: 6px;  
  width: 550px;
  text-align: justify;
}
tt
{
  font-family: Courier, Courier New;
  font-size: 10pt;
}
pre
{
  background-color: #ffffff;
  color: #000000;
  font-size: 10pt;
}
.NAV
{
  font-size: 7pt;
}
a.NAV
{
  color: #0000cc;
}
.TOC
{
  font-size: 9pt;
  color: #888888;
}
a.TOC
{
  color: #0000ff;
}
.INDEX
{
  font-size: 9pt;
}
a.INDEX
{
  color: #0000ff;
}
.TYPE
{
  font-size: 7pt;
  color: #888888;
}
.ITEM
{
  font-weight: bold;
  color: #000088;
}
.LABEL
{
  color: #000088;
}
.HISTORY
{
  color: #006600;
}
.AUTHOR
{
  color: #006600;
}
.COPYRIGHT
{
  color: #006600;
}
.PORTABILITY
{
  color: #006600;
}
.WARNING
{
  color: #aa0000;
}

.bitinfo
{
  width: 60px;
  font-style: italic;
  text-align: center;
}

.bitnum
{
  text-align: center;
}

.bitname
{
  font-weight: bold;
  text-align: center;
}

.tabitem
{
  width: 100px;
}

.tabname
{
  width: 200px;
}

.tabdesc
{
  width: 450px;
}

.value
{
  font-family: courier;
  text-align: right;
}

.tabsepar
{
  border-top-style: solid;
  border-bottom-style: solid;
  border-width: 2px;
  border-color: #888888;
  font-style: italic;
  text-align: center;
}
</style>
</head>
<body bgcolor="#FFFFFF">
<a name="robo_top_of_doc"></a>
<h3 align="center">TABLE OF CONTENTS</h3>
<ul>
<li><a class="TOC" href="#robo27">calypso_transaction.c</a></li>
<li><a class="TOC" href="#robo91">CalypsoCancelTransaction</a></li>
<li><a class="TOC" href="#robo117">CalypsoCommitTransaction</a></li>
<li><a class="TOC" href="#robo126">CalypsoStartTransaction</a></li>
<li><a class="TOC" href="#robo127">CalypsoStartTransactionEx</a></li>
</ul>
<h3>&nbsp;</h3>


<h1><a name="robo27"><span class="TYPE">[Modules]</span><a class="LABEL" name="calypso5ftransaction2ec">
calypso_transaction.c</a></h1>

<p class="NAV">[<a class="NAV" href="#robo_top_of_doc">top</a>][<a class="NAV" href="./modules.html#top">index</a>]</p>
<p class="ITEM">NAME</p>
<span class="NAME"><pre class="NAME">   SpringCard Calypso API :: Implementation of the Card+SAM transaction
</pre>
</span><p class="ITEM">COPYRIGHT</p>
<span class="COPYRIGHT"><pre class="COPYRIGHT">   (c) 2008 PRO ACTIVE SAS - See LICENCE.txt for licence information
</pre>
</span><p class="ITEM">AUTHOR</p>
<span class="AUTHOR"><pre class="AUTHOR">   Johann Dantant / PRO ACTIVE
</pre>
</span><p class="ITEM">HISTORY</p>
<span class="HISTORY"><pre class="HISTORY">   JDA 21/10/2008 : first public release
   JDA 15/08/2009 : implemented Revision 3
</pre>
</span>


<h2><a name="robo91"><span class="TYPE">[Functions]</span><a class="LABEL" name="CalypsoCancelTransaction">
CalypsoCancelTransaction</a></h2>

<p class="NAV">[<a class="NAV" href="#robo_top_of_doc">top</a>][<a class="NAV" href="./functions.html#top">index</a>]</p>
<p class="ITEM">NAME</p>
<span class="NAME"><pre class="NAME">   <strong>CalypsoCancelTransaction</strong>
</pre>
</span><p class="ITEM">DESCRIPTION</p>
<span class="DESCRIPTION"><pre class="DESCRIPTION">   Cancel a transaction (discarding all changes)
</pre>
</span><p class="ITEM">INPUTS</p>
<span class="INPUTS"><pre class="INPUTS">   CALYPSO_CTX_ST *ctx       : library context
</pre>
</span><p class="ITEM">RETURNS</p>
<span class="RETURNS"><pre class="RETURNS">   CALYPSO_RC                : 0 or an error code
</pre>
</span><p class="ITEM">SEE ALSO</p>
<span class="SEE_ALSO"><pre class="SEE ALSO">   <a class="LINK_37" href="#robo126">CalypsoStartTransaction</a>
   <a class="LINK_37" href="#robo127">CalypsoStartTransactionEx</a>
   <a class="LINK_37" href="#robo117">CalypsoCommitTransaction</a>
</pre>
</span>


<h2><a name="robo117"><span class="TYPE">[Functions]</span><a class="LABEL" name="CalypsoCommitTransaction">
CalypsoCommitTransaction</a></h2>

<p class="NAV">[<a class="NAV" href="#robo_top_of_doc">top</a>][<a class="NAV" href="./functions.html#top">index</a>]</p>
<p class="ITEM">NAME</p>
<span class="NAME"><pre class="NAME">   <strong>CalypsoCommitTransaction</strong>
</pre>
</span><p class="ITEM">DESCRIPTION</p>
<span class="DESCRIPTION"><pre class="DESCRIPTION">   Commit a transaction
</pre>
</span><p class="ITEM">INPUTS</p>
<span class="INPUTS"><pre class="INPUTS">   CALYPSO_CTX_ST *ctx       : library context
   BOOL           ratify_now : if TRUE, card will ratify its transaction immediately
                               if FALSE, the ratification will happen on the next APDU
                               received by the card (call <a class="LINK_12" href="./calypso_card_session_c.html#robo109">CalypsoCardSendRatificationFrame</a>)
</pre>
</span><p class="ITEM">RETURNS</p>
<span class="RETURNS"><pre class="RETURNS">   CALYPSO_RC                : 0 or an error code
</pre>
</span><p class="ITEM">NOTES</p>
<span class="NOTES"><pre class="NOTES">    This function performs he following sequence (with the appropriate parameters)
    - <a class="LINK_23" href="./calypso_sam_commands_c.html#robo120">CalypsoSamDigestClose</a>
    - <a class="LINK_23" href="./calypso_card_session_c.html#robo95">CalypsoCardCloseSecureSession</a>
    - <a class="LINK_23" href="./calypso_sam_commands_c.html#robo119">CalypsoSamDigestAuthenticate</a>
</pre>
</span><p class="ITEM">SEE ALSO</p>
<span class="SEE_ALSO"><pre class="SEE ALSO">   <a class="LINK_37" href="#robo126">CalypsoStartTransaction</a>
   <a class="LINK_37" href="#robo127">CalypsoStartTransactionEx</a>
   <a class="LINK_37" href="#robo91">CalypsoCancelTransaction</a>
</pre>
</span>


<h2><a name="robo126"><span class="TYPE">[Functions]</span><a class="LABEL" name="CalypsoStartTransaction">
CalypsoStartTransaction</a></h2>

<p class="NAV">[<a class="NAV" href="#robo_top_of_doc">top</a>][<a class="NAV" href="./functions.html#top">index</a>]</p>
<p class="ITEM">NAME</p>
<span class="NAME"><pre class="NAME">   <strong>CalypsoStartTransaction</strong>
</pre>
</span><p class="ITEM">DESCRIPTION</p>
<span class="DESCRIPTION"><pre class="DESCRIPTION">   Start a transaction between card and SAM (light implemenation)
   No data will be returned by the card, SAM's KIF will be deduce from card's key_no
</pre>
</span><p class="ITEM">INPUTS</p>
<span class="INPUTS"><pre class="INPUTS">   CALYPSO_CTX_ST *ctx       : library context
   BOOL           *ratified  : on output: was the previous session ratified, or not ?
   BYTE           key_no     : key number (card side)
</pre>
</span><p class="ITEM">RETURNS</p>
<span class="RETURNS"><pre class="RETURNS">   CALYPSO_RC                : 0 or an error code
</pre>
</span><p class="ITEM">NOTES</p>
<span class="NOTES"><pre class="NOTES">   key_no should be either CALYPSO_KEY_ISSUER, CALYPSO_KEY_LOAD or CALYPSO_KEY_DEBIT

   See <a class="LINK_23" href="#robo127">CalypsoStartTransactionEx</a> for implementation details
</pre>
</span><p class="ITEM">SEE ALSO</p>
<span class="SEE_ALSO"><pre class="SEE ALSO">   <a class="LINK_37" href="#robo127">CalypsoStartTransactionEx</a>
   <a class="LINK_37" href="#robo117">CalypsoCommitTransaction</a>
   <a class="LINK_37" href="#robo91">CalypsoCancelTransaction</a>
</pre>
</span>


<h2><a name="robo127"><span class="TYPE">[Functions]</span><a class="LABEL" name="CalypsoStartTransactionEx">
CalypsoStartTransactionEx</a></h2>

<p class="NAV">[<a class="NAV" href="#robo_top_of_doc">top</a>][<a class="NAV" href="./functions.html#top">index</a>]</p>
<p class="ITEM">NAME</p>
<span class="NAME"><pre class="NAME">   <strong>CalypsoStartTransactionEx</strong>
</pre>
</span><p class="ITEM">DESCRIPTION</p>
<span class="DESCRIPTION"><pre class="DESCRIPTION">   Start a transaction between card and SAM (full implementation)
</pre>
</span><p class="ITEM">INPUTS</p>
<span class="INPUTS"><pre class="INPUTS">   CALYPSO_CTX_ST *ctx       : library context
   BOOL           *ratified  : on output: was the previous session ratified, or not ?
   BYTE           key_no     : key number (card side)
   BYTE           kif        : key identifier (KIF - SAM side)
   BYTE           sfi        : short identifier of the file to read (0 if none)
   BYTE           rec_no     : record number of the record to read (0 if none)
   BYTE           data[]     : buffer to receive record's data
   CALYPSO_SZ     *datasize  : in  : size of data
                               out : actual length of data returned by the card
</pre>
</span><p class="ITEM">RETURNS</p>
<span class="RETURNS"><pre class="RETURNS">   CALYPSO_RC                : 0 or an error code
</pre>
</span><p class="ITEM">NOTES</p>
<span class="NOTES"><pre class="NOTES">    This function performs he following sequence (with the appropriate parameters)
    - <a class="LINK_23" href="./calypso_sam_commands_c.html#robo125">CalypsoSamSelectDiversifier</a>
    - <a class="LINK_23" href="./calypso_card_session_c.html#robo98">CalypsoCardOpenSecureSession1</a>, <a class="LINK_23" href="./calypso_card_session_c.html#robo99">CalypsoCardOpenSecureSession2</a> or <a class="LINK_23" href="./calypso_card_session_c.html#robo100">CalypsoCardOpenSecureSession3</a>
      (depending on the revision of the card)
    - <a class="LINK_23" href="./calypso_sam_commands_c.html#robo121">CalypsoSamDigestInit</a>

    Afterwards, every APDU (in/out) exchanged with the card will be forwarded to the SAM
    (using <a class="LINK_23" href="./calypso_sam_commands_c.html#robo122">CalypsoSamDigestUpdate</a>) until either <a class="LINK_23" href="#robo117">CalypsoCommitTransaction</a> or <a class="LINK_23" href="#robo91">CalypsoCancelTransaction</a>
    is called
</pre>
</span><p class="ITEM">SEE ALSO</p>
<span class="SEE_ALSO"><pre class="SEE ALSO">   <a class="LINK_37" href="#robo126">CalypsoStartTransaction</a>
   <a class="LINK_37" href="#robo117">CalypsoCommitTransaction</a>
   <a class="LINK_37" href="#robo91">CalypsoCancelTransaction</a>
</pre>
</span>
<hr />
Generated from <b>calypso_transaction.c</b> on Thu Jun 24 12:26:44 2010<br />
</body>
</html>
